<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>地区分页</title>
</head>
<body>
<ul>
  {% for item in page %}
    <li>{{ item.addr }}</li>
  {% endfor %}
</ul>
<div>
  {% with name='张涵弈' %}
    <h1>{{ name }}</h1>
  {% endwith %}
  {% if page.has_previous == True %}
    <a href="{% url 'booktest:pagination' page.number|add:-1 %}">上一页</a>
  {% endif %}
  {% for index in plist %}
    {% if index == page.number %}
      <span>{{ index }}</span>
    {% else %}
      <a href="{% url 'booktest:pagination' index %}">{{ index }}</a>
    {% endif %}
  {% endfor %}
  {% if page.has_next == True %}
    <a href="{% url 'booktest:pagination' page.number|add:+1 %}">下一页</a>
  {% endif %}

</div>
</body>
</html>